package interfaces.menu.options;

import logic.nodes.nodeSettings.Settings;
import main.InitGame;
import interfaces.menu.AbsMenu;
import interfaces.options.OptionsContainer;

import settings.SoundSettings;

import fileHandling.ProfileHandler;
import fileHandling.language.interfaces.OptionsWindowText;
import fileHandling.language.options.Sounds;

public class SoundOptionsContent extends OptionContent {
	
	private OptionsContainer soundOptions;
	
	public SoundOptionsContent(OptionsMenu optionsMenu, AbsMenu menu) {
		super(optionsMenu, menu, "sound.xml", SoundSettings.get());
		
		soundOptions = createOptionsContainer(OptionsWindowText.Sound, Sounds.Master_Volume);
	}
	
	@Override
	protected void apply() {
		SoundSettings settings = SoundSettings.get();
		settings.copySettings(new Settings(soundOptions), false);
		ProfileHandler.changeSettings(SoundSettings.get());
		InitGame.get().changeSoundSettings();
	}
}